package com.college.common.utils.redis;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * @author 小C工作室
 * @date 2022/7/4 18:12
 * @project manager_system_server
 * @company 韦伯创想
 * @description 包装类型工具
 */
public class PackagingTypeUtil {

	public static int filterNullInteger(Integer i) {
		return i == null ? 0 : i;
	}

	public static double filterNullDouble(Double i) {
		return i == null ? 0.0 : i;
	}

	public static Long filterNullLong(Long i) {
		return i == null ? 0L : i;
	}

	public static BigDecimal filterNullBigDecimal(BigDecimal b) {
		return b == null ? BigDecimal.ZERO : b;
	}

	public static Boolean filterNullBoolean(Boolean b) {
		return b == null ? Boolean.FALSE : b;
	}

	public static String filterNullString(String s) {
		if (s == null) {
			return "";
		}
		return s;
	}

	public static <T> List<T> filterNullList(List<T> s) {
		if (s == null) {
			return new ArrayList();
		}
		return s;
	}

	public static <T> LinkedList<T> filterNullLinkedList(LinkedList<T> s) {
		if (s == null) {
			return new LinkedList();
		}
		return s;
	}


}
